<template>
	<div v-if="portalId!='0'">
		<portal :portal-id="portalId"></portal>
	</div>
	<div v-else>
		<div v-if="pageLoading">
			<el-main>
				<el-card shadow="never">
					<el-skeleton :rows="1"></el-skeleton>
				</el-card>
				<el-card shadow="never" style="margin-top: 15px;">
					<el-skeleton></el-skeleton>
				</el-card>
			</el-main>
		</div>
		<work v-if="dashboard=='1'" @on-mounted="onMounted"></work>
		<widgets v-else @on-mounted="onMounted"></widgets>
	</div>
</template>

<script>
import work from './work'
import widgets from './widgets'
import portal from './portal'
export default {
	name: "dashboard",
	components: {
		work,
		widgets,
		portal
	},
	data(){
		return {
			portalId:this.$TOOL.data.get("USER_INFO").portalId==''?"0":this.$TOOL.data.get("USER_INFO").portalId,
			pageLoading: true,
			dashboard: '0'
		}
	},
	created(){
		this.dashboard = this.$TOOL.data.get("USER_INFO").dashboard || '0';
	},
	mounted(){
	},
	methods: {
		onMounted(){
			this.pageLoading = false
		}
	}
}
</script>

<style>
</style>
